#!/bin/bash

$SVN_PATH_ON_DISK = "/src/usr/trunk"
$TEMP_PATH = "/src/usr/submit_temp"
$KERNEL_PATH = "hw1"
$EXTRA_FILES_PATH = "tools/submitters.txt hw1_test/hw1_test.c hw1_test/hw1_wrappers.c hw1_test/hw1_wrappers.h"
$OUTPUT_ZIP = "$SVN_PATH_ON_DISK/submissions/hw1_308878438.zip"

cd $SVN_PATH_ON_DISK
svn update

if [ -d $TEMP_PATH ]; then
	rm -r $TEMP_PATH
fi

mkdir -p $TEMP_PATH/zip_temp

svn export hw1 $TEMP_PATH/kernel

tar -cvzf $TEMP_PATH/zip_temp/kernel.tar.gz $TEMP_PATH/kernel/*

cp $EXTRA_FILES_PATH $TEMP_PATH/zip_temp

zip $OUTPUT_ZIP $TEMP_PATH/zip_temp/*

echo "All Done!"